﻿using Simple.Framework.Ioc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;

/*********************************************************
 * 命名空间 Simple.BasicNet.Core.Pipeline
 * 接口名称 PipeExtension
 * 开发人员：11920
 * 创建时间：2023/4/12 11:08:15
 * 描述说明：
 * 更改历史：
 * 
 * *******************************************************/
namespace SimpleNet
{
	public static class PipeLineExtension
	{

		public static IHost ConfigutionPipeline(this IHost host,Action<IHost> action)
		{
			if (action==null)
				throw new ArgumentNullException("action");
			action.Invoke(host);
			return host;
		}
		public static IHost ConfigutionPipeline<TIPipeLine>(this IHost host) where TIPipeLine : IPipeline
		{
			var container = Container.GetContainer();
		    container.RegisterSingleton<IPipeline,TIPipeLine>().Autowird();
			return host;
		}

	}
}
